/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2022-2023. All rights reserved.
 */

package toolcbc

// QueryCreditCouponsRequest 查询云上子客户信用额度请求体
type QueryCloudCreditCouponsRequest struct {
	Body *QueryCreditCouponsBody `json:"body,omitempty"`
}

type QueryCreditCouponsBody struct {
	CustomerIds []string `json:"customer_ids"`
}

type QueryCloudCreditCouponsResponse struct {
	CreditCoupons  *[]CreditCoupon `json:"credit-coupons,omitempty"`
	HttpStatusCode int             `json:"-"`
}

type CreditCoupon struct {
	// 客户账号ID
	CustomerId string `json:"customer_id"`

	// 客户欠款总额度
	DebtAmount *float64 `json:"debt_amount,omitempty"`

	// 客户可用总额度
	Amount *float64 `json:"amount,omitempty"`

	// 币种 CNY人民币。
	Currency *string `json:"currency,omitempty"`

	// 度量单位1元
	MeasureId *int32 `json:"measure_id,omitempty"`
}

// AdjustCreditCouponRequest 调整云上子客户的信用额度请求体
type AdjustCloudCreditCouponRequest struct {
	Body *AdjustCloudCreditCouponBody `json:"body,omitempty"`
}
type AdjustCloudCreditCouponBody struct {
	// 客户账号ID
	CustomerId string `json:"customer_id"`

	//调整类型, 1--增加,2 --减少
	AdjustType int32 `json:"adj_type"`

	//调整的虚拟额度，单位为元，且取值大于0且精确到小数点后2位
	Amount float64 `json:"amount"`
}

// AdjustCloudCreditCouponReponse 调整云上子客户的信用额度返回体
type AdjustCloudCreditCouponReponse struct {
	HttpStatusCode int `json:"-"`
}

//QueryCloudCreditRecordRequest 查询云上转售子客户信用额度调整记录请求体
type QueryCloudCreditRecordRequest struct {
	// 客户账号ID。
	CustomerId string `json:"customer_id"`

	//偏移量,从0开始,默认为0
	Offset *int32 `json:"offset,omitempty"`

	//每次查询的记录数量,默认为10
	Limit *int32 `json:"limit,omitempty"`
}

//QueryCloudCreditRecordResponse 查询云上转售子客户信用额度调整记录返回体
type QueryCloudCreditRecordResponse struct {
	Records        *[]CreditAdjustmentRecord `json:"records,omitempty"`
	TotalCount     *int32                    `json:"total_count,omitempty"`
	HttpStatusCode int                       `json:"-"`
}

type CreditAdjustmentRecord struct {
	// 调整信用额度记录的ID
	ID string `json:"id"`

	// 调整信用额度的具体额度
	Amount *float64 `json:"amount,omitempty"`

	// 调整信用额度的操作类型,1--增加,2--减少
	OperationType *int32 `json:"operation_type,omitempty"`

	// 调整信用额度操作员的登录名称
	Operator *string `json:"operator,omitempty"`

	// 调整信用额度的操作时间
	OperationTime *string `json:"operationTime,omitempty"`
}
